/*SwP/hCRseghcC3FHjA4JzD+EDuYIRUCNjWmFDoY5f1pO8HM2SfyWeUpZjChTZQOq*/
import { ajax } from 'nc-lightapp-front';

/**
 * 
 * @formId    表单id
 * @props    
 * @key    编辑后事件的key
 */
function currentTypeAfterFormEvents(formId, props, key) {
	let src = props.cardTable.getValByKeyAndIndex('bodys', 0, 'top_itemid')?props.cardTable.getValByKeyAndIndex('bodys', 0, 'top_itemid').value:"isDef";
	ajax({
		url: '/nccloud/arap/ref/ratecontrol.do',
		async:false,
		data: {
			pk_org: props.form.getFormItemsValue(formId, 'pk_org') ? props.form.getFormItemsValue(formId, 'pk_org').value : null,
			pk_currtype: props.form.getFormItemsValue(formId, 'pk_currtype') ? props.form.getFormItemsValue(formId, 'pk_currtype').value : null,
			ratekey: 'rate',
			rateType:props.form.getFormItemsValue(formId, 'pk_ratetype')?props.form.getFormItemsValue(formId, 'pk_ratetype').value : null,
            topid:src
		},
		success: (res) => {
			if (res.success) {
				props.form.setFormItemsDisabled(formId, {
					'rate': !res.data,//币种编辑后触发 的，只控制汇率即可，其余还是在编辑前控制
				});
			}
		}
	});
}


export { currentTypeAfterFormEvents };


/*SwP/hCRseghcC3FHjA4JzD+EDuYIRUCNjWmFDoY5f1pO8HM2SfyWeUpZjChTZQOq*/